<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>提交订单</title>
		<#include "/WEB-INF/ftl/user/include.ftl" />
        <link type="text/css" rel="stylesheet" href="${base}/css/user/order_submit.css" />
        <script type="text/javascript" src="${base}/js/user/order_submit.js"></script>
    </head>
    <body>
		<#include "/WEB-INF/ftl/user/header.ftl" />
        <div class="navigation">
            <a href="javascript:void(0);">装机方案</a>&nbsp;&gt;
			提交订单
        </div>
        <div class="wrapper">
            <div class="pic-bar">&nbsp;</div>
			<div class="main">
				<h1 class="title">填写核对订单信息</h1>
				<div class="content">
					<div class="block">
						<h2 class="block-hd">购买的装机方案</h2>
						<div class="block-bd">
							<table>
								<thead>
									<tr>
										<th><span class="picture">图片</span></th>
										<th><span class="component">部件</span></th>
										<th class="last"><span class="price">价格</span></th>
									</tr>
								</thead>
								<tbody>
									<tr>
										<td>
											<a target="_blank" href="javascript:void(0);" class="picture">
												<img width="120" height="90" src="${base}/pic/default.jpg" alt="" />
												<img width="120" height="90" src="${base}/pic/default.jpg" alt="" />
											</a>
										</td>
										<td>
											<ul class="component">
												<#assign mainBoard = scheme.mainBoard.model />
												<li title="${mainBoard}"><span>主板：</span>${mainBoard}</li>
												<#assign cpu = scheme.cpu.model />
												<li title="${cpu}"><span>CPU：</span>${cpu}</li>
												<#assign memory = scheme.memory.model />
												<li title="${memory}"><span>内存：</span>${memory}</li>
												<#assign disk = scheme.disk.model />
												<li title="${disk}"><span>硬盘：</span>${disk}</li>
												<#if scheme.graphics??>
													<#assign graphics = scheme.graphics.model />
												<li title="${graphics}"><span>显卡：</span>${graphics}</li>
												</#if>
												<#if scheme.chassis??>
													<#assign chassis = scheme.chassis.model />
												<li title="${chassis}"><span>机箱：</span>${chassis}</li>
												</#if>
												<#if scheme.power??>
													<#assign power = scheme.power.model />
												<li title="${power}"><span>电源：</span>${power}</li>
												</#if>
												<#if scheme.radiator??>
													<#assign radiator = scheme.radiator.model />
												<li title="${radiator}"><span>散热器：</span>${radiator}</li>
												</#if>
												<#if scheme.driver??>
													<#assign driver = scheme.driver.model />
												<li title="${driver}"><span>光驱：</span>${driver}</li>
												</#if>
												<#if scheme.monitor??>
													<#assign monitor = scheme.monitor.model />
												<li title="${monitor}"><span>显示器：</span>${monitor}</li>
												</#if>
												<#if scheme.soundBox??>
													<#assign soundBox = scheme.soundBox.model />
												<li title="${soundBox}"><span>音箱：</span>${soundBox}</li>
												</#if>
												<#if scheme.soundCard??>
													<#assign soundCard = scheme.soundCard.model />
												<li title="${soundCard}"><span>声卡：</span>${soundCard}</li>
												</#if>
												<#if scheme.networkAdapter??>
													<#assign networkAdapter = scheme.networkAdapter.model />
												<li title="${networkAdapter}"><span>网卡：</span>${networkAdapter}</li>
												</#if>
											</ul>
										</td>
										<td><span class="price">&yen;<b>${scheme.price}</b>元</span></td>
									</tr>
								</tbody>
							</table>
						</div>
					</div>
					<div class="block">
						<h2 class="block-hd">用户收货信息</h2>
						<div class="block-bd">
							<#assign user = Session.user />
							<#if user.realName?? && user.realName!="" && user.phone?? && user.phone!="" && user.deliveryAddress?? && user.deliveryAddress!="" && user.postcode?? && user.postcode!="">
							<div class="address-saved">
								<h3 class="address-saved-hd">保存的收货地址</h3>
								<ul class="address-saved-bd">
									<li>
										<#assign savedAddress = (user.realName+"，"+user.phone+"，"+user.deliveryAddress?html+"，"+user.postcode)?replace('\\s+', ' ', 'r') />
										<input type="radio" name="address" value="${savedAddress}" checked="checked" id="savedAddress" />
										<label for="savedAddress">${savedAddress}</label>
									</li>
									<li>
										<input type="radio" name="address" value="" id="otherAddress" />
										<label for="otherAddress">其他收货地址</label>
									</li>
								</ul>
							</div>
							<ul class="address-input" style="display:none;">
							<#else>
							<ul class="address-input">
							</#if>
								<li>
									<span>收货人姓名：</span>
									<input type="text" name="name" id="name" class="input-text" />
								</li>
								<li>
									<span>联系电话：</span>
									<input type="text" name="phone" id="phone" class="input-text" />
								</li>
								<li>
									<span>所在省市：</span>
									<select name="province" id="province">
										<option value="">请选择省份</option>
										<option value="江苏省">江苏省</option>
									</select>
									<select name="city" id="city">
										<option value="">请选择城市</option>
										<option value="南京市">南京市</option>
									</select>
									<select name="area" id="area">
										<option value="">请选择地区</option>
										<option value="鼓楼区">鼓楼区</option>
									</select>
								</li>
								<li>
									<span>街道地址：</span>
									<input type="text" name="address" id="address" class="input-text" />
								</li>
								<li>
									<span>邮政编码：</span>
									<input type="text" name="postcode" id="postcode" class="input-text" />
								</li>
							</ul>
						</div>
					</div>
					<div class="bottom">
						<#assign schemeId = scheme.id?c />
						<a href="${base}/schemeDetail.do?id=${schemeId}" class="back blue">&lt;&lt;返回装机方案</a>
						<form id="orderForm" action="${base}/submitOrder.do" method="post">
						  	<input type="hidden" name="order.scheme.id" value="${schemeId}" id="orderSchemeId" />
						  	<input type="hidden" name="order.deliveryAddress" id="orderAddress" />
							<input type="button" value="提交订单" class="input-button submit" onclick="submitOrder();" />
                        </form>
					</div>
				</div>
			</div>
        </div>
		<#include "/WEB-INF/ftl/user/footer.ftl" />
    </body>
</html>
